﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Authentificated.master" AutoEventWireup="true" CodeFile="Data.aspx.cs" Inherits="UserManagement_Data" %>

<asp:Content ID="Content1" ContentPlaceHolderID="MCPH_Auth" Runat="Server">
    <asp:ObjectDataSource ID="odsSubject" runat="server" 
        DataObjectTypeName="PM.Entities.Subject"
        TypeName="PM.BusinessLayer.DataController"
        SelectMethod="SelectSubjects"
        DeleteMethod="DeleteSubject">
    </asp:ObjectDataSource>
    
    <asp:ObjectDataSource ID="odsSpeciality" runat="server" 
        DataObjectTypeName="PM.Entities.Speciality"
        TypeName="PM.BusinessLayer.DataController"
        SelectMethod="SelectSpecialities"
        DeleteMethod="DeleteSpeciality">
    </asp:ObjectDataSource>
    
    <asp:ObjectDataSource ID="odsGroup" runat="server" 
        DataObjectTypeName="PM.Entities.Group"
        TypeName="PM.BusinessLayer.DataController"
        SelectMethod="SelectGroups"
        DeleteMethod="DeleteGroup">
    </asp:ObjectDataSource>
    
    <table border="0" width="100%">
        <tr>
            <td><h1>Предмети</h1></td>
            <td><h1>Спеціальності</h1></td>
            <td><h1>Групи</h1></td>
        </tr>
        <tr>
            <td>
                <asp:TextBox ID="tbSubjectName" runat="server" />
                <asp:ImageButton ID="imgBtnAddSubject" ToolTip="Додати" runat="server" OnClick="btnAddSubject_Click" ImageUrl="~/Images/add1.jpeg" />
                <%--<asp:Button ID="btnAddSubject" runat="server" Text="Додати" OnClick="btnAddSubject_Click" />--%><br /><br /></td>
            <td>
                <asp:TextBox ID="tbSpeciality" runat="server" />
                <asp:ImageButton ID="ImageButton1" ToolTip="Додати" runat="server" OnClick="btnAddSpeciality_Click" ImageUrl="~/Images/add1.jpeg" /><br /><br />
                <%--<asp:Button ID="btnAddSpeciality" runat="server" Text="Додати" OnClick="btnAddSpeciality_Click" />--%></td>
            <td>
                <asp:TextBox ID="tbGroup" runat="server" />
                <asp:ImageButton ID="ImageButton2" ToolTip="Додати" runat="server" OnClick="btnAddGroup_Click" ImageUrl="~/Images/add1.jpeg" /><br /><br />
                <%--<asp:Button ID="btnGroup" runat="server" Text="Додати" OnClick="btnAddGroup_Click" />--%></td>
        </tr>
        <tr>
            <td valign="top">
                <asp:GridView ID="grvSubjects" runat="server" 
        DataSourceID="odsSubject" CssClass="UserGridView"
        AutoGenerateColumns="false"
        DataKeyNames="SubjectID">
        <EmptyDataTemplate>
            Поки що не має жодного предмету
        </EmptyDataTemplate>
        <Columns>
            <asp:TemplateField>
                <ItemTemplate>
                    <asp:Label ID="lblSubjectID" runat="server" Text='<%# Bind("SubjectID") %>' Visible="false" /></ItemTemplate>
            </asp:TemplateField>
            
            <asp:TemplateField HeaderText="Предмет">
                <ItemTemplate>
                    <asp:Label ID="lblSubjectName" runat="server" Text='<%# Bind("Name") %>' /></ItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField HeaderText="Дія">
                <ItemTemplate>
                    <asp:ImageButton ID="imgBtnDeleteSubject" runat="server" ToolTip="Видалити" CommandName="Delete" ImageUrl="~/Images/remove.jpg" />
                    <%--<asp:LinkButton ID="lbtDeleteSubject" runat="server" CommandName="Delete" Text="Видалити" />--%>
                </ItemTemplate>
            </asp:TemplateField>
        </Columns>
    </asp:GridView>
            </td>
            <td valign="top">
                <asp:GridView ID="grvSpiciality" runat="server" 
        DataSourceID="odsSpeciality" CssClass="UserGridView"
        AutoGenerateColumns="false"
        DataKeyNames="SpecialityID">
        <EmptyDataTemplate>
            Поки що не має жодної спеціальності
        </EmptyDataTemplate>
        <Columns>
            <asp:TemplateField>
                <ItemTemplate>
                    <asp:Label ID="lblSpicialityID" runat="server" Text='<%# Bind("SpecialityID") %>' Visible="false" /></ItemTemplate>
            </asp:TemplateField>
            
            <asp:TemplateField HeaderText="Спеціальність">
                <ItemTemplate>
                    <asp:Label ID="lblSpicialityName" runat="server" Text='<%# Bind("Name") %>' /></ItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField HeaderText="Дія">
                <ItemTemplate>
                    <asp:ImageButton ID="imgBtnDeleteSpeciality" ToolTip="Видалити" runat="server" CommandName="Delete" ImageUrl="~/Images/remove.jpg" />
                    <%--<asp:LinkButton ID="lblDeleteSpiciality" runat="server" CommandName="Delete" Text="Видалити" />--%>
                </ItemTemplate>
            </asp:TemplateField>
        </Columns>
    </asp:GridView>
            </td>
            <td valign="top">
                <asp:GridView ID="grvGroup" runat="server" 
        DataSourceID="odsGroup" CssClass="UserGridView"
        AutoGenerateColumns="false"
        DataKeyNames="GroupID">
        <EmptyDataTemplate>
            Поки що не має жодної групи
        </EmptyDataTemplate>
        <Columns>
            <asp:TemplateField>
                <ItemTemplate>
                    <asp:Label ID="lblGroupID" runat="server" Text='<%# Bind("GroupID") %>' Visible="false" /></ItemTemplate>
            </asp:TemplateField>
            
            <asp:TemplateField HeaderText="Група">
                <ItemTemplate>
                    <asp:Label ID="lblGroupName" runat="server" Text='<%# Bind("GroupNumber") %>' /></ItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField HeaderText="Дія">
                <ItemTemplate>
                    <asp:ImageButton ID="imgBtnDeleteGroup" runat="server" ToolTip="Видалити" CommandName="Delete" ImageUrl="~/Images/remove.jpg" />
                    <%--<asp:LinkButton ID="lbtDeleteGroup" runat="server" CommandName="Delete" Text="Видалити" />--%>
                </ItemTemplate>
            </asp:TemplateField>
        </Columns>
    </asp:GridView>
            </td>
        </tr>
    </table>
    
 


</asp:Content>

